Electronic device and frame transmission method of electronic device

ABSTRACT

The present invention provides a frame transmission method of an electronic device, wherein the frame transmission method includes the steps of: receiving a pause frame from another electronic device, wherein the pause frame includes a plurality of inter frame gap control indicator, and each of the inter frame gap control indicator includes a plurality of packet size ranges and corresponding pause times; selecting one of the inter frame gap control indicator according to a priority of a first packet to be sent to the other electronic device, and determining a first inter frame gap according to which packet size range the first packet belongs to; and after a first frame including the first packet is sent to the other electronic device, at least waiting for the first inter frame gap before starting to send a second frame to the other electronic device.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention relates to frame transmission, and moreparticularly, to a frame transmission method of an electronic device.

2. Description of the Prior Art

In the IEEE 802.3x specification, a pause frame is mentioned for thereceiving end to transmit the pause frame to the transmitting end whenthe network is congested, so as to notify the transmitting end tosuspend sending out packets to alleviate the congestion. In addition,before the transmitting end can start over to send the packet to thereceiving end, the transmitting end needs to wait until a pause timeindicated by the pause frame expires or the receiving end sends anotherpacket to notify that it can resume receiving the packet. However, inthe above operation, when network congestion occurs, the transmittingend will always switch between a full-speed transmission mode and asuspended transmission mode when transmitting packets, such that thepacket flow is extremely uneven. In addition, the receiving end needs tocontinuously detect a current state of the packet buffer to transmit thepause frame in time, which also causes processing burdens on circuits ofthe receiving end.

SUMMARY OF THE INVENTION

One of the objectives of the present invention is to provide a packettransmission method for a network device, which can adjust a pause timeafter subsequent packet transmission according to the size and thepriority of the packet, such that the overall packet flow can be moreeven, in order to prevent the transmitting end from sending too manypackets instantly and causing network congestion or accumulation ofpackets in the receiving end.

At least one embodiment of the present invention provides a frametransmission method of an electronic device. The frame transmissionmethod comprises: establishing a link with another electronic device toestablish a plurality of virtual lanes, wherein each of the plurality ofvirtual lane has a corresponding priority; receiving a pause frame fromthe another electronic device, wherein the pause frame comprises aplurality of inter frame gap control indicators, and each of theplurality of inter frame gap control indicators indicates a plurality ofpacket size ranges and corresponding pause times; referring to the pauseframe to select one of the plurality of inter frame gap controlindicators according to a priority of a first packet to be sent to theanother electronic device, and determining a first inter frame gapaccording to which packet size range a packet size of the first packetbelongs to; sending a first frame comprising the first packet to theanother electronic device through one of the plurality of virtual lanesthat corresponds to a same priority as the first packet; and after thefirst frame is sent to the another electronic device, at least waitingfor the first inter frame gap before starting to send a second frame tothe another electronic device.

At least one embodiment of the present invention provides an electronicdevice configured to establish a link with another electronic device toestablish a plurality of virtual lanes. Each of the plurality of virtuallane has a corresponding priority. The electronic device comprises areceiving circuit, a inter frame gap controller and a transmittingcircuit. The receiving circuit is configured to receive a pause framefrom the another electronic device. The pause frame comprises aplurality of inter frame gap control indicators, and each of theplurality of inter frame gap control indicators indicates a plurality ofpacket size ranges and corresponding pause times. The inter frame gapcontroller is configured to refer to the pause frame to select one ofthe plurality of inter frame gap control indicators according to apriority of a first packet to be sent to the another electronic device,and to determine a first inter frame gap according to which packet sizerange a packet size of the first packet belongs to. The transmittingcircuit is configured to send a first frame comprising the first packetto the another electronic device through one of the plurality of virtuallanes that has a same priority as the first packet. After the firstframe is sent to the another electronic device, at least wait for thefirst inter frame gap before starting to send a second frame to theanother electronic device.

At least one embodiment of the present invention provides a frametransmission method of an electronic device. The frame transmissionmethod comprises: establishing a link with another electronic device toestablish a plurality of virtual lanes, wherein each of the plurality ofvirtual lane has a corresponding priority; sending a pause frame to theanother electronic device, wherein the pause frame indicates a pluralityof inter frame gap control indicators, and each of the plurality ofinter frame gap control indicators comprises a plurality of packet sizeranges and corresponding pause times for being used by the anotherelectronic device; and receiving a plurality of frames from the anotherelectronic device, wherein each frame is received through a virtual lanethat has a same priority as a packet in the frame, and a gap between theplurality of frames is determined by the another electronic deviceaccording the plurality of packet size ranges and corresponding pausetimes indicated by at least one of the plurality of inter frame gapcontrol indicators.

At least one embodiment of the present invention provides an electronicdevice configured to establish a link with another electronic device toestablish a plurality of virtual lanes. Each of the plurality of virtuallane has a corresponding priority. The electronic device comprises atransmitting circuit and a receiving circuit. The transmitting circuitis configured to send a pause frame to the another electronic device.The pause frame comprises a plurality of inter frame gap controlindicators, and each of the plurality of inter frame gap controlindicators indicates a plurality of packet size ranges and correspondingpause times for being used by the another electronic device. Thereceiving circuit is configured to receive a plurality of frames fromthe another electronic device. Each frame is received through a virtuallane that has a same priority as a packet in the frame. A gap betweenthe plurality of frames is determined by the another electronic deviceaccording the plurality of packet size ranges and corresponding pausetimes indicated by at least one of the plurality of inter frame gapcontrol indicators.

These and other objectives of the present invention will no doubt becomeobvious to those of ordinary skill in the art after reading thefollowing detailed description of the preferred embodiment that isillustrated in the various figures and drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram illustrating a network system according to anembodiment of the present invention.

FIG. 2 is a flowchart illustrating a frame transmission method of anelectronic device.

FIG. 3 is a diagram illustrating multiple virtual lanes establishedbetween electronic devices.

FIG. 4 is a diagram illustrating a pause frame according to anembodiment of the present invention.

FIG. 5 is a diagram illustrating the frame transmission method accordingto an embodiment of the present invention.

DETAILED DESCRIPTION

FIG. 1 is a diagram illustrating a network system according to anembodiment of the present invention. As shown in FIG. 1 , the networksystem includes two electronic devices 110 and 120, where the electronicdevices 110 and 120 are connected by a network cable 130 for datatransmission and reception. In the present embodiment, the electronicdevices 110 and 120 both support Full-Duplex Ethernet and IEEE 802.3xspecification. The electronic device 110 includes a processing circuit111, a receiving circuit 112, a pause frame parser 114, an inter framegap controller 116 and a transmitting circuit 118; and the electronicdevice 120 includes a processing circuit 121, a receiving circuit 122, apause frame parser 124, an inter frame gap controller 126 and atransmitting circuit 128. The electronic devices 110 and 120 in thepresent embodiment can be any electronic devices that can use a networkcable for data transmission and reception, such as switches, routers orany electronic devices that can be connected to a network cable. It isnoticed that in another embodiment, the pause frame parser 114, theinter frame gap controller 116 and the processing circuit 111 can beintegrated in a single circuit according to design requirements, but thepresent invention is not limited thereto.

In the following description of the operation of the electronic device110, the flowchart shown in FIG. 2 can be referred to in conjunctionwith FIG. 1 . In step 200, the flow starts, and the electronic device110 establishes a link with the electronic device 120 and starts signaltransmission and reception. In the present embodiment, the electronicdevice 110 and the electronic device 120 can establish multiple virtuallanes on a single Ethernet link, e.g., eight virtual lanes 310_1-310_8shown in FIG. 3 , where the virtual lanes 310_1-310_8 can beindividually paused or restarted, that is, when the packet transmissionof one of the virtual lanes is paused, the packet transmission of othervirtual lanes may not need to be interrupted. Since the content of thevirtual lane can refer to the standard of IEEE 802.1 Qbb, and is knownto those skilled in the art, further description is omitted here forsimplicity. In addition, each virtual lane is assigned a priorityconforming with IEEE 802.1P (in one embodiment, the priority may be aclass of service (CoS)), where a quantity of priorities may be eight,that is, each virtual lane has one of eight priorities, but the presentinvention is not limited thereto.

In step 202, the receiving circuit 112 receives the frame/packet fromthe electronic device 120 through the network cable 130, parses thereceived frame/packet, and then sends the frame/packet to the processingcircuit 111 for subsequent processing. In the present embodiment, thereceiving circuit 112 receives a pause frame from the electronic device120, and transmits the pause frame to the pause frame parser 114 foranalysis. In step 204, the pause frame parser 114 analyzes the receivedpause frame and determines whether the pause frame conforms to aspecific format. If No, the flow proceeds with step 206; if Yes, theflow proceeds with step 208. Specifically, referring to the diagram of apause frame 400 conforming to a specific format according to anembodiment of the present invention as shown in FIG. 4 , the pause frame400 includes multiple fields, and the multiple fields may include a6-byte destination address, a 6-byte source address, a 2-byte frametype, a 2-byte operation code (opcode), multiple 2-byte inter frame gapcontrol indicators (in the present embodiment, eight inter frame gapcontrol indicators #0-#7 are provided) and eight sets of timeinformation, where one inter frame gap indicator corresponds to a set oftime information. For example, the inter frame gap control indicator #0points to the time information #0_0-#0_N0, the inter frame gap controlindicator #1 points to the time information #1_0-#1_N1, . . . , and theinter frame gap control indicator #7 points to the time information#7_0-#7_N7. It should be noted that the destination address, the sourceaddress, the type and the opcode in the pause frame 400 shown in FIG. 4are fields defined by the IEEE 802.3x specification, and their contentsand functions may be referred to the IEEE 802.3x specification. In thepresent embodiment, since only a part of the code words of the 2-byteopcode in the IEEE 802.3x specification have definitions, the pauseframe 400 can be configured to set the opcode to a code word that hasnot yet been defined in the current IEEE 802.3x specification, such as0xfd, to indicate that the pause frame 400 has a specific format. In thepresent embodiment, if the content of the opcode is defined in thecurrent IEEE 802.3x specification, e.g., the opcode 0x0001, the pauseframe parser 114 determines that the received pause frame does notconform to a specific format; and if the content of the opcode conformsthe code words corresponding to the specific format, such as 0xfd, thepause frame parser 114 determines that the received pause frame conformsto the specific format.

In step 204, the main content used for checking if the pause frame 400conforms to the specific format relies on the opcode, the inter framegap control indicator and the time information, and the operations anddefinitions of the remaining fields can refer to the IEEE 802.3xspecification. Therefore, the following description mainly focuses onthe opcode, the inter frame gap control indicator and the timeinformation.

In step 206, since the pause frame received by the receiving circuit 112does not conform to the specific format, the flow control of the IEEE802.3x specification is performed. The operation of the electronicdevice 110 can skip the inter frame gap controller 116, and thetransmission circuit 118 suspends the transmission of subsequent framesuntil the pause time indicated in the pause frame expires, or until thereceiving circuit 112 receives a message indicating that packettransmission can be resumed.

In step 208, the inter frame gap controller 116 temporarily stores theinter frame gap control indicators #0-#7 and the corresponding timeinformation shown in FIG. 4 in the internal register or memory fordetermining the inter frame gap for subsequent frame transmission.Specifically, the inter frame gap control indicators #0-#7 canrespectively correspond to different priorities (e.g., different classesof service (CoS)), and each inter frame gap control indicator andcorresponding time information can be regarded as including multiplepacket size ranges and corresponding pause times. When the processingcircuit 111 needs to transmit data to the electronic device 120, thetransmitting circuit 118 transmits the information related to the packetsize of the current packet to be transmitted to the inter frame gapcontroller 116, and the inter frame gap controller 116 determines thecorresponding pause time according to the priority and the packet sizeof the current packet to be transmitted to the electronic device 120,and determines the inter frame gap accordingly, such that thetransmitting circuit 118 pauses packet transmission for a period of time(that is, the inter frame gap) after transmitting the current packet tothe electronic device 120, and then starts over to send the next frame.In the present embodiment, the inter frame gap controller 116 candetermine the priority of the packet by checking the priority field inthe header of the virtual local area network of the packet. For example,the inter frame gap controller 116 determines which of the eightpriorities the priority of the packet belongs to. The packet size can bethe size of the packet that is actually sent by the network layer, thedata link layer or the physical layer in the frame.

The operation of the inter frame gap controller 116 is described indetail. In the following embodiments, it is assumed that the inter framegap controller 116 has selected the inter frame gap control indicator #0according to the priority of the current packet to be transmitted to theelectronic device 120, and the inter frame gap control indicator #0 canbe used to indicate multiple packet size ranges. For example, the interframe gap control indicator #0 includes 2 bytes (16 bits), among whichthe 0th to 3rd bits can be used to represent 16 or fewer effective indexvalues, and the 4th to 15th bits can be used to represent a parameterINC, where the packet size range represented by the inter frame gapcontrol indicator #0 may be shown in the following Table 1:

TABLE 1 Index value Packet size range 0 PKT_S < 64 B 1 64 B ≤ PKT_S < 64B + INC 2 64 B + INC ≤ PKT_S < 64 B + 2*INC 3 64 B + 2*INC ≤ PKT_S < 64B + 3*INC . . . . . . 15  64 B + 14*INC ≤ PKT_S

In the content of Table 1, “PKT_S” is used to indicate the size of thepacket, “B” is used to indicate a byte, and the parameter INC can be anysuitable value, such as 64 bytes.

In one embodiment, each of the time information #0_0-#0_N0 correspondingto the inter frame gap control indicator #0 includes 2 bytes (16 bits),where the 0th to 3rd bits can be used to indicate the pause timecalculated by using the packet size, and the 4th to 15th bits can beused to indicate a fixed pause time, where the time information#0_0-#0_N0 may be shown in the following Table 2:

TABLE 2 Pause time calculated Index value by using packet size fixedpause time Time information 0 0 #0_0 Time information PKT_S*T T #0_1Time information (PKT_S/2)*T 2*T #0_2 Time information (PKT_S/4)*T 3*T#0_3 . . . . . . . . . Time information (PKT_S/2{circumflex over ( )}(7− 1))*T 7*T #0_7 . . . . . . . . .

In the content of Table 2, time information #0_0 corresponds to theindex value “0” of Table 1, time information #0_1 corresponds to theindex value “1” of Table 1, time information #0_2 corresponds to theindex value “2” of Table 1, and so on. “T” is used to indicate thelength of the pause time, where “T” can be 8 bit time, and one bit timeis the time required for the electronic device 110 to transmit 1-bitdata. For example, for a 100 Mbps (Million bits per second) Ethernet, 1bit time is 10 nanoseconds; and for a 1000 Mbps Ethernet, 1 bit time is1 nanosecond. In addition, the pause time calculated by using the packetsize can directly use the integer part of the calculation result, andthe pause time of each of the time information #0_0-#0_N0 is the sum ofthe pause time calculated using the packet size and the fixed pause timein Table 2.

In one example, it is assumed that the transmission circuit 118 iscurrently preparing to transmit a 130-byte packet to the electronicdevice 120. When the parameter INC is set to 64 bytes, since the packetsize corresponds to the index value “2” in Table 1, the calculationresult of the pause time corresponds to the time information #0_2 inTable 2, where the pause time calculated by using the packet size is65*T, and the fixed pause time is 2*T. Therefore, the pause timecalculated from Table 2 is 67*T.

After the pause time of the frame to be transmitted by the transmissioncircuit 118 is determined, the inter frame gap controller 116 candetermine the inter frame gap according to the pause time. Specifically,since IEEE 802.3x defines that a minimum preset gap between twoconsecutive frames is not shorter than 96 bit time, the inter frame gapcontroller 116 can add 96 bit time to the pause time calculatedaccording to Table 2, to obtain the final inter frame gap. For example,assuming that the transmitting circuit 118 is currently preparing totransmit a 130-byte packet to the electronic device 120, the pause timecalculated according to Table 2 is 67*8 bit time, and the inter framegap finally determined by the inter frame gap controller 116 is(96+67*8) bit time.

It should be noted that the above calculation of the pause time andinter frame gap is only an example and not a limitation of the presentinvention. As long as the inter frame gap controller 116 can determinedifferent inter frame gaps according to the priority of the packet to betransmitted and the packet size, the contents of Table 1 and Table 2above can be changed accordingly, or can be integrated into a singlelook-up table that can be used to directly determine the correspondinginter frame gap based on the packet size. These related implementationchanges should all belong to the scope of the present invention.

In addition, the above embodiment uses the inter frame gap controlindicator #0 and the corresponding time information #0_0-#0_N0 forillustration. In other embodiments, if the packets that need to betransmitted to the electronic device 120 have different priorities (forexample, the packets need to be transmitted through different virtuallanes later), the inter frame gap controller 116 may select other interframe gap control indicators and corresponding time information, andthese other inter frame gap control indicators and corresponding timeinformation have parameters which are not all the same. That is, thepacket size range and parameter INC in Table 1 and the pause time andfixed pause time calculated by using the packet size in Table 2 may varyaccording to different priorities.

In step 210, the transmission circuit 118 selects a virtual lane thathas the same priority as the packet, and transmits the frame to theelectronic device 120 through the virtual lane corresponding to the samepriority, and the flow proceeds to step 208. For example, if thepriority field of the header of the virtual local area network of thepacket indicates that the priority of the packet is “0”, the packet istransmitted through the virtual lane 310_1; if the priority field of theheader of the virtual local area network of the packet indicates thatthe priority of the packet is “1”, the packet is transmitted through thevirtual lane 310_2; and so on. In addition, after transmission of thecurrent frame is completed, the transmitting circuit 118 pauses frametransmission for a period of time before transmitting the next frame,such that the next frame and the currently transmitted frame have theabove-determined inter frame gap. In detail, assuming that thetransmitting circuit 118 needs to transmit a first frame, a second frameand a third frame in sequence, the inter frame gap controller 116 candetermine a first inter frame gap corresponding to the first frame and asecond inter frame gap corresponding to the second frame according tothe above-mentioned mechanism, such that the transmitting circuit 118starts to transmit the second frame after pausing frame transmission forthe time period of the first inter frame gap since an end of thetransmission of the first frame, and starts to transmit the third frameafter pausing frame transmission for the time period of the second interframe gap since an end of the transmission of the second frame.

It should be noted that if the pause frame transmitted from theelectronic device 120 in the beginning has the pause frame 400 shown inFIG. 4 , the inter frame gap controller 116 temporarily buffers each ofthe inter frame gap control indicators #0˜#7 recorded in the pause frame400, the packet size range recorded in the corresponding timeinformation, and information about the corresponding pause time or interframe gap. Then, when the transmission circuit 118 needs to transmitpackets, the inter frame gap controller 116 may sequentially determinean inter frame gap between an end of transmission of each packet and anext frame according to the priority and packet size of each packet, inorder to accurately control the network flow between the electronicdevice 110 and the electronic device 120. In this way, the problem ofserious uneven transmission speed of the electronic device 110 describedin the prior art can be prevented. In addition, since the packet sizerange and the corresponding pause time recorded in the pause frame 400or information of inter frame gap are temporarily stored in the memoryor the register in the inter frame gap controller 116 for subsequentlong-term use. Therefore, the electronic device 120 does not need tosend a pause frame to the electronic device 110 frequently, and onlyneeds to send a new pause frame 400 to update the packet size range andthe corresponding pause time or inter frame gap when necessary (e.g.,when a network congestion occurs suddenly), such that each packet mayhave a larger inter frame gap for subsequent transmission.

In addition, since the network interface speed of the electronic devices110 and 120 must not be higher than the committed information rate (CIR)of the network service provider, if the electronic devices 110 and 120use the highest rate for transmission, the electronic devices 110 and120 continuously switch between the full-speed transmission state andthe suspended transmission state. Therefore, the electronic device 120can determine the packet size range and the corresponding pause time orthe information of inter frame gap according to the above-mentionedcommitted information rate, and transmit the information carried in thepause frame 400 to the electronic device 110, such that the flow betweenthe electronic devices 110 and 120 may be relatively even.

In the description of the above embodiment, the electronic device 110receives the pause frame from the electronic device 120, determines theinter frame gap according to the priority of the packet and the packetsize, and then transmits the frame to the electronic device 120.However, the electronic devices 110 and 120 support full-duplexEthernet. Similarly, the electronic device 120 can also receive thepause frame from the electronic device 110, and transmit the frame tothe electronic devices 110 after determining the inter frame gapaccording to the priority of the packet and the packet size. Since theyhave the same or similar operations, that is, the operations of theprocessing circuit 121, the receiving circuit 122, the pause frameparser 124, the inter frame gap controller 126 and the transmissioncircuit 128 of the electronic device 120 are similar to the processingcircuit 111, the receiving circuit 112, the pause frame parser 114, theinter frame gap controller 116 and the transmitting circuit 118 of theabove-mentioned electronic device 110, so the relevant details are notrepeated in detail here.

FIG. 5 is a diagram illustrating the frame transmission method accordingto an embodiment of the present invention. In FIG. 5 , it is assumedthat the electronic device 110 sequentially transmits packets of virtuallanes 310_1, 310_2, 310_1 and 310_4 to the electronic device 120, andthe virtual lanes 310_1, 310_2 and 310_4 have different priorities.After the electronic device 110 receives the pause frame from theelectronic device 120, at time t1, the electronic device 110 can startto determine the inter frame gap according to the priority level and thepacket size of the current packet to be transmitted to the electronicdevice 120 as described in the above embodiments. As shown in FIG. 5 ,the electronic device 110 uses the first inter frame gap to transmit thepacket of the virtual lane 310_1, and then uses the second inter framegap to transmit the packet of the virtual lane 310_2, and then uses thefirst inter frame gap to transmit the packet of the virtual lane 310_1(assuming that the packet size of the packet of the virtual lane 310_1and the packet size of the previous packet are similar or the same), andfinally the third inter frame gap is used to transmit the packet of thevirtual lane 310_4. According to the above arrangement, the electronicdevice 110 needs to receive a pause packet only once, and can calculatethe inter frame gap suitable for each packet according to theinformation in the pause packet, such as inter frame gap controlindicators #0-#7 and the corresponding time information. In this way,the electronic device 110 can transmit the packets with a stabletransmission rate.

Briefly summarizing the present invention, in the electronic device andthe related frame transmission method of the present invention, afterreceiving a pause frame from another electronic device, the inter framegap controller in the electronic device can determine the inter framegap required for subsequent frame transmission according to theinformation recorded in the pause frame. Through the present invention,the flow between electronic devices can be appropriately controlled toprevent the problem that the frame transmission switches between thefull-speed transmission state and the suspended transmission state whenthe network is congested in the prior art. In addition, since anotherelectronic device does not need to send the pause frame all the time,the processing burden on another electronic device can be reduced.

Those skilled in the art will readily observe that numerousmodifications and alterations of the device and method may be made whileretaining the teachings of the invention. Accordingly, the abovedisclosure should be construed as limited only by the metes and boundsof the appended claims.

What is claimed is:
 1. A frame transmission method of an electronicdevice, comprising: establishing a link with another electronic deviceto establish a plurality of virtual lanes, wherein each of the pluralityof virtual lane has a corresponding priority; receiving a pause framefrom the another electronic device, wherein the pause frame comprises aplurality of inter frame gap control indicators, and each of theplurality of inter frame gap control indicators indicates a plurality ofpacket size ranges and corresponding pause times; referring to the pauseframe to select one of the plurality of inter frame gap controlindicators according to a priority of a first packet to be sent to theanother electronic device, and determining a first inter frame gapaccording to which packet size range a packet size of the first packetbelongs to; sending a first frame comprising the first packet to theanother electronic device through one of the plurality of virtual lanesthat corresponds to a same priority as the first packet; and after thefirst frame is sent to the another electronic device, at least waitingfor the first inter frame gap before starting to send a second frame tothe another electronic device.
 2. The frame transmission method of claim1, wherein the priority of the first packet is a class of service (CoS).3. The frame transmission method of claim 1, wherein the plurality ofinter frame gap control indicators correspond to different priorities,respectively, and the plurality of packet size ranges and correspondingpause times in each of the plurality of inter frame gap controlindicators are not all the same.
 4. The frame transmission method ofclaim 1, further comprising: referring to the pause frame to determine asecond inter frame gap according to which packet size range a packetsize of a second packet to be sent to the another electronic devicebelongs to; sending the second frame comprising the second packet to theanother electronic device through a virtual lane that has a samepriority as the second packet; and after the second frame is sent to theanother electronic device, at least waiting for the second inter framegap before starting to send a third frame to the another electronicdevice.
 5. The frame transmission method of claim 1, wherein theplurality of pause times are not all the same.
 6. The frame transmissionmethod of claim 5, wherein determining the first inter frame gapaccording to which packet size range the packet size of the first packetbelongs to comprises: determining a first pause time according to whichpacket size range the packet size of the first packet to be sent to theanother electronic device belongs to; and calculating the first interframe gap according to the first pause time and a minimum predeterminedgap.
 7. The frame transmission method of claim 6, wherein determiningthe first pause time according to which packet size range the packetsize of the first packet to be sent to the another electronic devicebelongs to comprises: determining a pause time calculated by using thepacket size and a fixed pause time according to which packet size rangethe packet size of the first packet to be sent to the another electronicdevice belongs to; and calculating the first pause time according to thepause time calculated by using the packet size and the fixed pause time.8. The frame transmission method of claim 1, further comprising:temporarily storing the plurality of inter frame gap control indicatorsin the pause frame and the plurality of packet size ranges andcorresponding pause times indicated by each inter frame gap controlindicator into the electronic device, for determining inter frame gapscorresponding to multiple frames subsequently transmitted to the anotherelectronic device.
 9. An electronic device, configured to establish alink with another electronic device to establish a plurality of virtuallanes, wherein each of the plurality of virtual lane has a correspondingpriority, the electronic device comprising: a receiving circuit,configured to receive a pause frame from the another electronic device,wherein the pause frame comprises a plurality of inter frame gap controlindicators, and each of the plurality of inter frame gap controlindicators indicates a plurality of packet size ranges and correspondingpause times; an inter frame gap controller, configured to refer to thepause frame to select one of the plurality of inter frame gap controlindicators according to a priority of a first packet to be sent to theanother electronic device, and to determine a first inter frame gapaccording to which packet size range a packet size of the first packetbelongs to; and a transmitting circuit, configured to send a first framecomprising the first packet to the another electronic device through oneof the plurality of virtual lanes that has a same priority as the firstpacket, and after the first frame is sent to the another electronicdevice, at least wait for the first inter frame gap before starting tosend a second frame to the another electronic device.
 10. The electronicdevice of claim 9, wherein the priority of the first packet is a classof service (CoS).
 11. The electronic device of claim 9, wherein theplurality of inter frame gap control indicators correspond to differentpriorities, respectively, and the plurality of packet size ranges andcorresponding pause times in each of the plurality of inter frame gapcontrol indicators are not all the same.
 12. The electronic device ofclaim 9, wherein the inter frame gap controller is further arranged torefer to the pause frame to determine a second inter frame gap accordingto which packet size range a packet size of a second packet to be sentto the another electronic device belongs to; and the transmittingcircuit is further arranged to send the second frame comprising thesecond packet to the another electronic device through a virtual lanethat has a same priority as the second packet; and after the secondframe is sent to the other electronic device, the transmitting circuitis further arranged to at least wait for the second inter frame gapbefore starting to send a third frame to the another electronic device.13. An electronic device, configured to establish a link with anotherelectronic device to establish a plurality of virtual lanes, whereineach of the plurality of virtual lane has a corresponding priority, theelectronic device comprising: a transmitting circuit, configured to senda pause frame to the another electronic device, wherein the pause framecomprises a plurality of inter frame gap control indicators, and each ofthe plurality of inter frame gap control indicators indicates aplurality of packet size ranges and corresponding pause times for beingused by the another electronic device; and a receiving circuit,configured to receive a plurality of frames from the another electronicdevice, wherein each frame is received through a virtual lane that has asame priority as a packet in the frame, and a gap between the pluralityof frames is determined by the another electronic device according theplurality of packet size ranges and corresponding pause times indicatedby at least one of the plurality of inter frame gap control indicators.